﻿using UnityEngine;
using System.Collections;

public class Bullet : MonoBehaviour
{
	private  Rigidbody2D rig;
	public float speed = 10f;


	// Use this for initialization
	void Start ()
	{
		rig = GetComponent<Rigidbody2D > ();
		rig.velocity = Vector2.up * speed;
	}

	void OnTriggerEnter2D (Collider2D other)
	{
		Plane plane = other.GetComponent <Plane> ();
		if (plane != null) {
			plane.GetHurt (1);

		}
	}
}